<include file="Public/min-header"/>

<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable">
                                    <thead>
                                    <tr role="row">
                                        <th class="sorting" tabindex="0" style="width:50px; text-align:center;">ID</th>
                                        <th class="sorting" tabindex="0" style="width:350px;  ">商品名称</th>
                                        <th class="sorting" tabindex="0">客户昵称</th>
                                        <th class="sorting" tabindex="0" style="width:50px; text-align:center;">状态</th>
                                        <th class="sorting" tabindex="0" style="width:150px; text-align:center;">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="lists" item="v" key="k" >
                                        <tr role="row" align="center">
                                            <td>{$v.id}</td>
                                            <td style="text-align:left;">{$v.goods_id}{$v.goods_id|get_goods_name}</td>
                                            <td style="text-align:left;">{$v.nickname}</td>
                                            <td>
                                                <img width="20" height="20" src="__PUBLIC__/images/<if condition='$v[status] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('case','id','{$v.id}','status',this)"/>
                                            </td>

                                            <td>
                                                <a class="btn btn-primary" href="{:U('Order/detail',array('order_id'=>$v['order_id']))}"><i class="fa fa-pencil"></i></a>
                                                <a   href="{:U('Order/del_case',array('id'=>$v['id']))}"  	 class="btn btn-danger"  title="删除"><i class="fa fa-trash-o"></i></a>
                                            </td>
                                        </tr>
                                    </foreach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div><!-- /.box-body -->
                </div><!-- /.box -->
            </div>
        </div>
    </section>
</div>


<script>

    function delfun(obj){
        layer.confirm('确认删除？', {
                btn: ['确定','取消'] //按钮
            }, function(){
                $.ajax({
                    type : 'post',
                    url : $(obj).attr('data-url'),
                    dataType : 'json',
                    success : function(data){
                        if(data){
                            $(obj).parent().parent().remove();
                            layer.alert('删除成功', {icon: 2});  //alert('删除失败');
                        }else{
                            layer.alert('删除失败', {icon: 2});  //alert('删除失败');
                        }
                    }
                })
            }, function(index){
                layer.close(index);
                return false;// 取消
            }
        );
    }
</script>
</body>
</html>